public class SuShu {
    public static void main(String[] args) {
        int temp=1;
        for(int i=2;i<=2000;i++) {
            if(Check(i)==1)
            {
                if(temp%5!=0)
                {
                    System.out.print(i+" ");
                }else
                {
                    System.out.println(i+" ");
                }
                temp++;
            }
        }
    }
    public static int Check(int i)
    {
        int flag=1;
        for(int num=2;num<i; num++)
        {
            if(i%num==0&&i!=num)
            {
                flag=0;
            }
        }

        return  flag;
    }
}
